package dog.weatherwallpaper;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.text.util.Linkify;
import android.widget.TextView;
import dog.weatherwallpaper.utils.App;

public final class AboutActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		super.setContentView(R.layout.about);

		updateVersionText();

		TextView credits = (TextView) findViewById(R.id.credit);
		credits.setText(Html.fromHtml(super.getString(R.string.about_content)));
		Linkify.addLinks(credits, Linkify.ALL);
	}

	@Override
	protected void onResume() {
		super.onResume();
		updateVersionText();
	}

	private void updateVersionText() {
		TextView tv = (TextView) findViewById(R.id.version);
		String version = App.getManifestVersionName() + " (" + App.getManifestVersionCode() + ")";
		tv.setText(getString(R.string.version) + ": " + version);
	}
}